package itheima.com.zuoye.chose_sorting;

import java.util.Arrays;

public class chose_sorting {
    public static void main(String[] args) {
        int arr[]={76,23,45,12,34,56,78,90,11,33,55,66,77,88,99,10};
        for (int i = 0; i < arr.length-1; i++) {
            int min=i;
            for (int j= i+1; j < arr.length; j++){
                if (arr[j]<arr[min]){
                    min=j;
                }

            }
            if (min!=i){
                swap(arr,i,min);
            }
        }
        System.out.println(Arrays.toString( arr));

    }
    public static void swap(int[] arr,int i,int j){
        int temp=arr[i];
        arr[i]=arr[j];
        arr[j]=temp;
    }

}
